<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对话框</title>
    <style>
        .dialog {
            position: relative;
            margin-top: 50px;
            margin-left: 50px;
            padding-left: 20px;
            width: 300px;
            line-height: 2;
            background: blue;
            color: white;
        }
        .dialog::before {
            content: '';
            position: absolute;
            border: 8px solid;
            border-color: transparent blue transparent transparent;
            /* border-color: transparent transparent #ccc transparent; border属性*/  
            left: -16px;
            top: 8px;
        }
    </style>
</head>
<body>
    <div class="dialog">这是一个对话框</div>
</body>
</html>